package com.ld.security.common.mybatis.base.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ld.security.common.mybatis.anno.SqlKey;
import com.ld.security.common.core.base.column.ListJson;
import com.ld.security.common.core.base.column.ListString;
import com.ld.security.common.core.base.column.MapJson;
import com.ld.security.common.core.base.entity.ESuperEntity;
import com.ld.security.common.mybatis.constant.SqlCondition;
import com.ld.security.common.mybatis.core.entity.SqlDeptEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.Map;

/**
 * 基本原型
 */

@Data
public abstract class SuperEntity implements ESuperEntity {


	@ApiModelProperty("编号")
	@TableId
	@SqlKey
	private String id;


	@ApiModelProperty("更新时间")

	@SqlKey(SqlCondition.lt)
	private Date uptTime;
	

	@ApiModelProperty("创建时间")
	@SqlKey(SqlCondition.gt)
	private Date crtTime;

	
	@ApiModelProperty("表额外信息数组")
	private ListJson listJson;

	@ApiModelProperty("表额外信息对象")
	private MapJson mapJson;


	public <E extends SuperEntity> E putJsonKey(String k,Object v){
		if(this.mapJson == null){
			this.mapJson = new MapJson();
		}
		this.mapJson.put(k,v);
		return (E)this;
	}

}
